package com.example.ui_test.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.ui_test.R

class MyAdapter(layoutResId: Int, mList: ArrayList<String>?) :
    BaseQuickAdapter<String, BaseViewHolder>(layoutResId, mList), LoadMoreModule {
    override fun convert(holder: BaseViewHolder, item: String) {
        holder.setText(R.id.tv, item)
    }

    override fun getItem(position: Int): String {
        return if (data.size > 0) data[position % data.size] else data[position]
    }

    override fun getDefItemCount(): Int {
        return 200
    }
}